The main advantage of the script recorder is that you can create animation without writing scripts. However, there are also disadvantages:
Difficult to modify To change a recorded animation, you must either edit the script ToolBook created or record the animation again.
Difficult to create smooth movement It may be hard to create uniform spacing and direction between each step of the animation.
If you need to create smooth, easily modifiable animation, you may want to examine the topics in the Useful Scripts section of this book.......
strChecked
scriptRecorderPopup1
visited
false
strChecked
scriptRecorderPopup1
strChecked
To use the script recorder:
1. Make sure the objects you want to move are not selected.
2. Choose Start Recording from the Edit menu.
3. Drag the objects along the path you want them to follow, clicking frequently to record the movement.
4. Choose Stop Recording from the Edit menu.
5. In the script of the button that starts the animation, choose Paste Recording from the script editor's Edit menu..
strChecked
pageUnits
visited
false
strChecked
strChecked
Page Units:
Each pixel on the screen is several page units wide by several units tall. The amount varies depending on your screen resolution. The sysPageUnitsPerPixel system property will tell you how many page units there are for each horizontal and vertical pixel represented on the screen. For example, in standard VGA, there are 15 page units per horizontal pixel and 15 per vertical pixel.
The animation sysbook makes combining movement and frame animation easy. All you need to do is create a group of objects, specify a path, and then turn frame animation on.
in,ms
ThreeDeeRect
bottomLine
topLine
globe
MplayAnimation
animSysBookLoaded
enterpage
ZstopAnimation
animSysbookLoaded
leavePage
notifyBefore
animSysBookLoaded()
playAnimation 1
notifyAfter
animSysbookLoaded()
stopAnimation
curframe
anim_animationSettings
in,ms
ThreeDeeRect
bottomLine
topLine
Here we have our familiar animated earth with movement added.ded.
leavePage
enterpage
false
EKG monitor
label
myChapterID
false
visited
The path animation system book allows you to animate an object at either a constant or variable speed over the length of its path.
When a constant speed is chosen, the object moves over the length of its path at a steady rate. However, when a variable rate is chosen, the object moves quickly between distant points on its path and slowly between points that are near to one another.
illustrates an animation that is best done with a variable rate. The monitor's beam should move across the screen at a steady rate but up and down at varying rates.
anim_animationSettings
Start
MplayAnimation
variable
buttonUp
enterPage
playAnimation 1
"Beam"
notifyBefore
735,4545
startPosition
Start
ZstopAnimation
buttonUp
leavePage
stopAnimation
"Beam"
notifyBefore
Variable
MplayAnimation
buttonUp
playAnimation 1
"beam"
Variable Rate
Constant
MplayAnimation
buttonUp
playAnimation 2
"beam"
Constant Rate
in,ms
ThreeDeeRect
bottomLine
topLine
This example illustrates an animation that is best done with a variable rate. The monitor's beam should move across the screen at a steady rate but up and down at a faster rate..
enterPage
leavePage
false
Fish tank
label
myChapterID
false
visited
In this example, several fish are animated along different paths across the screen. The animations are set to loop continuously, so that the fish will endlessly complete the same cycle. The school of yellow fish was made by copying and pasting a single fish that was previously animated.
Each fish is a transparent bitmap with a white irregular polygon behind it as a mask.
in,ms
ThreeDeeRect
bottomLine
topLine
in,ms
ThreeDeeRect
bottomLine
topLine
placeholder
WjpositionChildViewer
<KinitAnimation
enterpage
endAnimation
leavepage
,&H.&
newbnds
positionChildViewer
serves
%the placeholder
train animation
-- on
opens
. On
sends
animate message
notifyAfter
"tank"
initAnimation
positionChildViewer
-- close
notifyBefore
endAnimation
isOpen
-- sizes
specified
r childViewer, bnds
newbnds= pageUnitsToClient(
strChecked
The aquatic scene below is actually taking place on another page in this book. A child viewer is displaying that page.
The rectangle behind the viewer has script to control its behavior.e rectangle behind it has script to control its behavior.
enterpage
leavepage
false
false
Path animation sysbook
label
myChapterID
false
visited
Multimedia ToolBook comes with a sysbook that makes animations along paths easy to create and maintain. You can animate along straight or curved paths.
in,ms
ThreeDeeRect
bottomLine
topLine
in,ms
ThreeDeeRect
bottomLine
topLine
Here are two examples of the types of paths you can use.to animation.
(( (
w{'w(w{
false
Using path animation
label
myChapterID
40,37,39,41
myPages
The authoring system book (mtb40.sbk) offers a way to create complex animation without writing complex code.
To distribute an application with animationr more information...........................
Often, you just want to move an object along a straight line. This page contains a handler for doing that. You pass it the object you want to move, the line that you want to move the object along, and how many steps you want to take along the line.
Note that this handler will move an object along angled lines as well. Once you've positioned the guiding lines, you can hide them.
strChecked
PmoveObjectAlongPath
buttonclick
buttonclick
-- sends message handled
moveObjectAlongPath
m"path",15
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
Click each of the ellipses above to see them move along their respective paths.
PmoveObjectAlongPath
buttonclick
buttonclick
-- sends message handled
moveObjectAlongPath
"yoyo",40
strChecked
false
false
v#T#n#
Timing animation
label
myChapterID
false
visited
When you want animation to move at a particular speed regardless of the machine it's on, you can write a handler to check the time during the animation process.
The function timeGetTime() in the mmsystem DLL file is useful for this purpose. This function returns the time in milliseconds. The mmsystem DLL comes with Windows 3.1.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
The animated globe above is a series of 16 frames. The buttons controlling its speed set a user property of the globe called Delay to various values (0 for "Fast," 60 for "medium," and 120 for "Slow"). The script in the globe checks to see if at least that many milliseconds have passed before displaying the next frame....
speedControl
strChecked
globe
delay
buttonclick
buttonclick
delay
"globe"
strChecked
Fa&st
globe
delay
buttonclick
buttonclick
delay
"globe"
strChecked
&Medium
globe
delay
buttonclick
buttonclick
delay
"globe"
strChecked
Slo&w
strChecked
globe
4478050,10,0
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
enterpage
false
Simulating gravity
label
myChapterID
visited
This page has a useful handler for animating falling objects. You provide the handler with the object that you want to "drop," how tall that object is supposed to be, where the ground is, and the starting speed of the object.
Press the Animate button on the right to see a demonstration.{
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
ground
strChecked
V f J
strChecked
.animate
buttondown
animate message, handled
strChecked
out,false
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
Animate
thought
strChecked
thought5
strChecked
thought4
strChecked
thought3
strChecked
thought2
strChecked
thought1
strChecked
ground
finaly
accelerate
animate
animate
finaly =
U"ground"
accelerate
,2,finalY
,1.5,
5625,684
origloc
strChecked
strChecked
strChecked
strChecked
false
false
Animating with color
label
myChapterID
false
visited
Not all animation involves moving or hiding objects. You can create an animation just by setting the colors of various objects.
The object representing the TV screen has a script that cycles its rgbFill property through 512 colors of the RGB spectrum.
Each panel of the colorful sculpture on the right cycles through four colors.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
& 6 J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
curColor
fucurColor
gucurColor
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
curColor
fucurColor
gucurColor
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
curColor
fucurColor
gucurColor
-- cycles through four colors
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
curColor
fucurColor
gucurColor
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
"0"J
strChecked
strChecked
#0#J
strChecked
strChecked
6$F$J
strChecked
strChecked
L%\%J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
J)Z)J
strChecked
strChecked
>*N*J
strChecked
strChecked
2+B+J
strChecked
strChecked
.', "
.', "
oplastTime
timegettime
-- cycle through 512 colors
the rgb spectrum.
notifybefore
inc = 32 -- amount
each
orgbfill
r = (r+
g = (g+
b = (b+
lastTime
timegettime()
N/^/J
n/z/mp
strChecked
lastTime
strChecked
o P3&
strChecked
J1Z1J
strChecked
strChecked
strChecked
strChecked
strChecked
04@4J
strChecked
strChecked
b5r5J
strChecked
"626J
strChecked
strChecked
B7R7J
strChecked
strChecked
f8v8J
strChecked
&969J
strChecked
false
Useful scripts
label
myChapterID
17,18,19,20
myPages
This section contains reusable handlers you can use to make writing your animation scripts easier.
17,18,19,20
Animating buttons
label
myChapterID
visited
Buttons can display bitmap resources, which are stored in the book. In its normal state, a button displays the bitmap resource specified by its normalGraphic property. When you press the button, the button displays its invertGraphic. You can use these properties to create an animation effect.
The button on the right displays an animation when clicked.K
in,true
ThreeDeeRect
bottomLine
topLine
This button has two frames of animation: one specified by its normalGraphic, the other specified by its invertGraphic, which is displayed when clicked.
5bookref
,&H.&
,&H.&
false
5bookref
found
5bookref
notifyBefore
normalgraphic
k4 + 1
bitmap ("cd"&
bookref
notifyAfter
bref =
rl = resourceList("
found =
rl) = "cd"&i
C:\HOOK\CBT\NEWANIM.TBK
bookref
in,true
ThreeDeeRect
bottomLine
topLine
These buttons set their normalGraphic property to a series of images.lGraphic, the other specified by its invertGraphic.
arrow
5bookref
,&H.&
,&H.&
false
5bookref
found
5bookref
arrow
notifyBefore
normalgraphic
k6 + 1
bitmap ("arrow"&
bookref
notifyAfter
bref =
rl = resourceList("
found =
rl) = "
C:\HOOK\CBT\NEWANIM.TBK
bookref
false
false
Hiding and showing
label
myChapterID
false
visited
A common method for creating frame animation is to hide and show objects in a group using the hide and show commands.
This animation hides and shows one paint object after another. Each paint object shows the dog in a different position. A user property of the group keeps track of which frame is currently shown.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
curFrame
myCurFrame
myCurFrame
newFrame
-- This handler controls the animation
-- The
consists
18 paintobjects, named
-- 1
18, respectively. For each execution
(sent constantly
mode)
advanced one frame.
currently shown
stored
%a userProperty
notifybefore
numFrames = 18 --
paintObjects
ping
curFrame = myCurFrame
-- calculate
newFrame =
so we know what
h t (
curdog
lastTime
myCurFrame
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
h x J
strChecked
topLine
strChecked
strChecked
The running dog above is a series of 18 frames, shown one after the other. Small differences in the t at least 30 milliseconds have passed before displaying the next frame. This way, no more that 24 frames per second
false
f@^@^@
How it works
label
myChapterID
false
visited
To create frame animation, you display a series of images quickly in sequence, each one slightly different than the one preceding it. The differences between the frames cause the object's apparent movement.
The animation at the top is a series of sixteen paint objects, shown individually below.
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
out,true
ThreeDeeRect
strChecked
< L J
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
curFrame
myCurFrame
myCurFrame
newFrame
hides
shows frames (paintobjects)
the globe animation.
-- The paintObjects are named "1"
notifybefore
numFrames = 16 --
curFrame = myCurFrame
-- currently showing
newFrame =
-- store
myCurFrame
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
*!:!J
strChecked
strChecked
strChecked
#0#J
strChecked
in,true
ThreeDeeRect
strChecked
f$v$J
strChecked
bottomLine
strChecked
P#b%n%
topLine
strChecked
widget slows down everything,
notifybefore
lastTime
strChecked
Slow-Mo
in,true
ThreeDeeRect
strChecked
,(<(J
strChecked
bottomLine
strChecked
'()4)
topLine
\)l)J
strChecked
strChecked
This globe animation is a series of paintObjects, shown one after the other.......the other.
curFrame
myCurFrame
mycurframe
highlight
newFrame
moves the
over
appropriate globe.
"globes are
numbered "1"
notifybefore
numFrames = 16 --
paintObjects
current
showing:
curFrame = mycurframe
newFrame =
myCurFrame
<-L-J
myCurFrame
strChecked
*f.l.
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
.6>6J
strChecked
D7T7J
strChecked
*,848
\8l8J
strChecked
*D9L9
strChecked
*\:d:
strChecked
*t;|;
strChecked
strChecked
strChecked
strChecked
highlight
strChecked
false
Frame animation
label
myChapterID
chapterCount
topicCount
13,14,15
myPages
A common method to display a complex animation is to create several frames and show them in a series, similar to the way a movie works. This section covers the basics of frame animation using OpenScript.
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
4 D J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
trailerCountdown
lastTime
myAngle
strChecked
strChecked
strChecked
strChecked
minute
strChecked
counter
strChecked
enterpage
Moving on idle
label
myChapterID
false
visited
Whenever ToolBook is not running scripts, it receives the idle message. If you want an animation to run constantly while nothing else is happening, trigger each step of the animation upon the idle message.
The advantage to animation driven by the idle message is that you can interrupt the animation at any time to interact with other parts of the application. The key is to handle only one "step" of the animation per execution of the idle handler.handler.
in,true
ThreeDeeRect
strChecked
ballbounds
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
The bouncing ball moves by a small amount upon each execution of the idle handler. Note that you can press any of the buttons on the tool bar or go to another application at any time.during this animation.
elapsedTime
curDir
vector
maxBounce
150,15,-1
myInfo
strChecked
false
Move by command
label
myChapterID
false
visited
Use the move by command when you want to move an object relative to its current position. For example, the command "move rectangle id 1 by 45,90" would move this object 45 page units to the right and 90 page units down.
This example uses move by in a loop to move the golf ball into the hole. The amount that the ball moves for each loop is calculated from the positions of the two objects. Note that the ball goes into the hole no matter where it starts from.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
green
j z J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
out,false
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
Animate
false
Move to command
label
myChapterID
false
visited
Use move to to move an object to a specific place. This is useful when the animated path of one object is relative to the positions of other objects.
The example at the right shows a moon orbiting a planet. The path that the moon follows is not an ellipse; it's a polygon with 50 vertices. The example script simply moves the moon object to each vertex of the polygon, one after the other.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
orbit
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
out,false
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
.animate
buttondown
orbit
moonRef
animate
-- sends the animate message
-- moves
along
-- optimization: store
{reference
%we will
-- be refering
moonRef =
sz =
-- we are going
walk
, so let's
-- cache them
vs =
"orbit"
come
a list
pairs
-- one
each vertex. For
iteration
loop,
-- we
grab
y positions
E, subtract half
ball's
positioning relative
that
(vs)
strChecked
Animate
false
Move command
label
myChapterID
false
visited
Moving an object involves setting its position property for each step of the animation. Usually this is accomplished in a loop structure, such as step or while.
The commands to use for moving an object are move to and move by.
Toolbook uses page units as the unit of measure to specify position.%
pageUnitsPopup
buttonclick
buttonclick
"pageUnitsPopup"
strChecked
strChecked
Move <object> to <position>
This command moves the specified object to the position supplied, for example:
move polygon "x" to 0,0
Moves it to the upper-left corner of the screen.een..
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
strChecked
move toe Commandperty
shadow
strChecked
move toe Commandperty
* : J
strChecked
move toe Commandperty
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
strChecked
move bye Commandperty
shadow
strChecked
move bye Commandperty
strChecked
move bye Commandperty
strChecked
Move <object> by <amount>
This command moves the object by the x and y amounts supplied, for example:
move polygon "x" by 45,60
Moves it 45 page units to the right and 60 down. s downits down
false
Script recorder
label
myChapterID
false
visited
You can animate objects without writing scripts yourself by using the script recorder. This is useful when you want to animate one or more objects along an arbitrary path.
How to use the script recorder
When to use the script recorder
The animation to the right was created using the script recorder.
scriptRecorderPopup
buttonclick
buttonclick
"scriptRecorderPopup"
strChecked
strChecked
scriptRecorderPopup2
buttonclick
buttonclick
"scriptRecorderPopup2"
strChecked
strChecked
strChecked
strChecked
ThreeDeeRect
out,true
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
ThreeDeeRect
in,true
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
balloonpath
strChecked
cloudpath
strChecked
cloud
strChecked
strChecked
strChecked
strChecked
ThreeDeeRect
out,false
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
Animate
balloon
strChecked
&Button
false
Topics
strChecked
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
topicLabel
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
strChecked
Path animation sysbook
shadow
strChecked
Path animation sysbook
strChecked
Path animation sysbook
Position property
label
myChapterID
false
visited
Each object in ToolBook has a property called position that tells ToolBook where the object sits relative to the top and left edges of the page. Moving an object involves changing this property.
Position is a list of two numbers given in page units. In the illustration to the right, drag the object and notice how its position property changes.
pageUnitsPopup
buttonclick
buttonclick
"pageUnitsPopup"
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
descr
strChecked
The position is 1258,973. he illustration above is 1560,1455. ag the object=
strChecked
n ~ J
strChecked
strChecked
client
strChecked
strChecked
strChecked
ToolBook - POSITION.TBKign
strChecked
strChecked
strChecked
strChecked
File Edit View Page Object Draw
strChecked
9733page
yline
client
endpoint
endpoint
value
Znewb
cb =
client
xpix =
sysPageUnitsPerPixel
ypix =
b =
w =
v1 = x - w
v2 =
cb +
v3 = v1+w
v4 = y -
fref =
sz =
fpos = v3 +
*2,v2+(v4-v2)
y2 -
v4 - v2
strChecked
strChecked
centerLine
strChecked
xline
client
endpoint
endpoint
value
Znewb
xpix =
sysPageUnitsPerPixel
ypix =
cb =
client
b =
h =
v1 =
cb +
v2 = y - h
v3 = x -
v4 = v2 + h
fref =
sz =
fpos = v1+(v3-v1)
y2 -
y2,v4 +
v3 - v1
strChecked
strChecked
centerLine
strChecked
strChecked
1258page
strChecked
strChecked
strChecked
false
Chapter Headings
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
Topics
strChecked
strChecked
topic1
4 D J
pageId
strChecked
Path animation sysbookrks
check1
strChecked
strChecked
topic2
pageId
strChecked
Fish tankcorderity objects 25
check2
strChecked
strChecked
topic3
pageId
strChecked
EKG monitordtionsgbuttons 61
check3
strChecked
strChecked
Q + 2
topic4
pageId
strChecked
Moving frame animations62
check4
strChecked
strChecked
topic5
pageId
strChecked
Move by commandline4
check5
strChecked
strChecked
topic6
pageId
strChecked
Moving on idlec
check6
strChecked
strChecked
topic7
pageId
strChecked
Billy7r7
check7
strChecked
strChecked
topic8
pageId
strChecked
Barbara8
check8
strChecked
strChecked
topic9
strChecked
topic9r8K
check9
strChecked
strChecked
topic10
strChecked
topic108
check10
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
chapterLabel
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
: J J
strChecked
Using path animation
shadow
strChecked
Using path animation
strChecked
Using path animation
strChecked
Click on one of the topics below
to view information on that subject.......
95012313004110063205280234205
myChapterID
7,6,11,4,3,12
myPages
Moving objects
label
ASYM_BeenHere
Most animation involves moving an object from one place to another. The topics in this section discuss the various techniques for moving objects using OpenScript.
strChecked
placeholder
WjpositionChildViewer
train
<KinitAnimation
enterpage
train
leavepage
,&H.&
newbnds
positionChildViewer
.animate
train
serves
%the placeholder
train animation
-- on
opens
. On
sends
animate message
notifyAfter
initAnimation
positionChildViewer
-- close
notifyBefore
isOpen
-- sizes
specified
r childViewer, bnds
newbnds= pageUnitsToClient(
strChecked
strChecked
strChecked
leavepage
terpage
enterpage
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
topic
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
strChecked
Table of contents
shadow
strChecked
Table of contents
strChecked
Table of contents
strChecked
Click on one of the topics below to view information on that subject.ubject.
9501231240478869342129136941
extLines(
& "*.
& "*.
CRLF
enabled
B"OK"
[refFocus
B"defaultbutton"
= lowerCase(
olastSelected
oselectedTextLines <>
olastselected
tableOfContents
myChapter
myPages
chapterCount
topicCount
false
visited
24,27
selectChars
strChecked
tableOfContents
strChecked
60,Cats
68,Dogs
pageList
strChecked
chapter1
strChecked
pageID
Moving objectser
check1
strChecked
strChecked
chapter2
strChecked
pageID
Frame animation
check2
strChecked
strChecked
chapter3
Timing Animation 66
Simulating Gravity 67
topics
strChecked
pageID
Useful scriptsn
check3
strChecked
strChecked
chapter4
Chickens 26
Goats 25
topics
pageID
strChecked
Using path animation
check4
strChecked
strChecked
chapter5
strChecked
pageID
Untitled
check5
strChecked
strChecked
chapter6
strChecked
check6
strChecked
strChecked
chapter7
strChecked
check7
strChecked
strChecked
chapter8
strChecked
check8
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
This book shows you various techniques for animating objects, with and without writing handlers.
page "scriptRecorderPopup1"
toolbar
page "toolbar"
outline
Template Outline
page "outlineOrganizer"
location
clientSz
page "newChapterOrTopic"
Page "train"
Page "tv 1"
313,172
train
pageUnitsPopup
Page "pageunits"
buttonclick
buttonclick
close
The Animation Book
Page "tank"
4005,11130
scriptRecorderPopup
ScriptRecorderPopup2
page "scriptRecorderPopup2"
about
About Animation Book
page "aboutAnimation"
frame
screen
openwindow
closeWindow
openwindow
currentPage
pageUnitsToClient(
frame
T"screen"
closeWindow
435,450
extra
page "train"
4005,11130
MS Sans Serif
MS Sans Serif
MS Sans Serif
MS Sans Serif
MS Sans Serif
System
MS Sans Serif
false
MS Sans Serif
firstTime
System
MS Sans Serif
MS Sans Serif
MS Sans Serif
Times New Roman
1/23/95 1:01:11 PM
Courier New
MS Sans Serif
8:00 PM
Arial
info_LastSavedBy
info_LastSaved
Courier New
Claude Ostyn
Arial
chapterCount
MS Sans Serif
Courier New
1993,1994. Asymetrix Corporation. All Rights Reserved.
The path animation sysbook is not loaded. Animations in the "Path Animation" sections will not run. Be sure that mtb40anm.sbk are included in your startupSysbooks.
Adds new topic to this chapter.
contents
topicsBackground
Template &Outline
enterApplication
Change Chapter Name...
chaptersBackground
author
outline
Change Topic Name...
contents
TopicsBackground
entermenu
helpTemplate
Contents
leaveapplication
outline
toolbar
author
outline
toolbar
reader
outline
mstate
rebuildStructure
contents
outline
w, #?
s_temp_animNewBackground
chaptersBackground
This template is limited to
chapters.
skipDialog
/%chapterCount
chapterLimit
topicsBackground
newBackground
chapterLimit
chapter headings
chaptersBackground
topics
topicsBackground
w, #>
.', 7
w, #>
PBmyPages
voutline
curChapterId
myChapterID
pagelabel
chapterCount
outline
tabSpacer
curPageId
tableofcontents
tableOfContents
chaptersBackground
0%chapterCount
label
topicsBackground
qkinitializePage
rebuildStructure
.', "
extractName
extractID
,&H.&
itemOffset
O@middleGray
9@darkBlue
tabSpacer
tableOfContents
tableofcontents
updatechecks
tableOfContents
.', "
Cannot find book TMPLHELP.TBK
mydir
tmplhelp.tbk
helpTemplate
initializePage
w, #?
Enter new chapter name.
cancel
This template is limited to
chaptersBackground
label
rebuildStructure
tableOfContents
toolbar
chapterName
chapters.
skipDialog
/%chapterCount
chapterLimit
Untitled
topicsBackground
newChapter
cancel
Enter new topic name.
chaptersBackground
lastPage
label
rebuildStructure
tableOfContents
toolbar
chapterName
skipDialog
Untitled
topicsBackground
newTopic
cancel
Enter new name.
label
rebuildStructure
label
changeName
firstTime
saveAs
about
aboutAnimate
anim_StartSize
animSysbookLoaded
buttonGroup
gHeader
marker
gButtons
outline
spupp
X sizeIt
bSize
header
gOutline
rightBorder
sized
getSystemMetrics
exclientSz
maxSize
clientSz
getSystemMetrics
outlineOrganizer
openWindow
<+V!!
statusbar
fxclientSz
closeWindow
tableOfContents
toolbar
background
previous
topics
tableOfContents
toolbar
Table of contents
heading
enterBackground
tableOfContents
toolbar
leaveBackground
You cannot delete this page.
clear
You cannot cut this page.
This template does not support adding new pages to the table of contents.
newPage
qkinitializePage
initializePage
highlight
highlightColor
shadow
shadowColor
faceColor
highlight
highlightColor
shadow
shadowColor
faceColor
,&H.&
,&H.&
spupp
highlight
shadow
sized
pageID
curField
voutline
false
goPage
qkinitializePage
Zselected
pageID
buttondown
[darkBlue
selected
checkref
false
Cvisited
subPages
curID
pageID
pageID
OBmypages
value
updateChecks
pageID
pageID
label
updateLabels
previous
outline
topics
toolbar
topicsBackground
enterpage
myPages
topics
topicList
toolbar
heading
chapterLabel
label
OBmyPages
initializePage
topics
updateChecks
OBmyPages
updateCheckMarks
.', "
Cancel
Warning: this operation cannot be reversed using Undo.
chaptersBackground
curBK
rebuildStructure
You cannot delete the last page of this background.
topicsBackground
clear
.', "
Cancel
Warning: this operation cannot be reversed using Undo.
chaptersBackground
curBK
rebuildStructure
You cannot delete the last page of this background.
topicsBackground
newChapter
newPage
qkinitializePage
qkinitializePage
previous
highlight
highlightColor
shadow
shadowColor
faceColor
highlight
highlightColor
shadow
shadowColor
faceColor
,&H.&
,&H.&
spupp
highlight
shadow
sized
curCheck
Cvisited
pageID
curField
curPageID
label
topicList
checkRef
fieldRef
Cvisited
curPageId
pageID
curTopic
updateChecks
false
goPage
qkinitializePage
Zselected
pageid
buttondown
[darkBlue
selected
chaptersBackground
Cvisited
outline
topics
previous
toolbar
toolbarRef
enterpage
topicLabel
toolbar
heading
mychapterID
label
initializePage
backpage
qkinitializePage
myChapterID
topics
yunewTopic
newPage
chaptersBackground
author
qkinitializePage
nextPageParent
qkinitializePage
previous
.', "
Cancel
Warning: this operation cannot be reversed using Undo.
chaptersBackground
curBK
rebuildStructure
You cannot delete the last page of this background.
topicsBackground
clear
.', "
Cancel
Warning: this operation cannot be reversed using Undo.
chaptersBackground
curBK
rebuildStructure
You cannot delete the last page of this background.
topicsBackground
highlight
highlightColor
shadow
shadowColor
faceColor
highlight
highlightColor
shadow
shadowColor
faceColor
,&H.&
,&H.&
spupp
highlight
shadow
sized
SM_SWAPBUTTON
descr
client
xLine
yLine
yGroup
5nendpoint
yfield
getsystemmetrics
thisWin
getsystemmetrics
xGroup
xfield
descrField
buttonDown
xposc
select
end buttonClick
cloud
to handle buttonClick
balloon
yposb
yposc
balloonpath
cloudpath
xposb
move selection to
animate
.animate
buttonup
buttonClick
highlight
highlightColor
shadow
shadowColor
faceColor
highlight
highlightColor
shadow
shadowColor
faceColor
,&H.&
,&H.&
spupp
highlight
shadow
sized
highlight
highlightColor
shadow
shadowColor
faceColor
highlight
highlightColor
shadow
shadowColor
faceColor
,&H.&
,&H.&
spupp
highlight
shadow
sized
.animate
buttonup
holeLoc
randomBallLocation
animate
green
ballRef
gbounds
gsize
bSize
greenRef
randomBallLocation
.', 7
maxBounce
myInfo
ballBounds
myInfo
newPosition
frameBnds
{:myAngle
coords
minute
sweep
.', "
sweep
maxDisplay
timeGetTime
curTime
z:myAngle
counter
timeGetTime
timeGetTime
sweep
counter
mmsystem
enterpage
timeGetTime
obBounds
timegettime
timeGetTime
mmsystem
accelerate
,&H.&
safeHeight
ground
thought
accelerate
<KinitAnimation
animate
,&H.&
thought
b;origloc
initanimation
lastTime
newTime
timeGetTime
lastFrame
newFrame
delay
timeGetTime
timeGetTime
mmsystem
enterpage
startY
You can only move objects along lines or angledLines.